import { request } from "../request";
import { ADMINAPI } from "../const";

export function getProductList() {
  return request({
    url: `${ADMINAPI}/product/list`,
  });
}

export function addProduct(data) {
  return request({
    url: `${ADMINAPI}/product`,
    method: "post",
    data,
  });
}

export function deleteProduct(id) {
  return request({
    url: `${ADMINAPI}/product/${id}`,
    method: "delete",
  });
}

export function updateProduct(data) {
  return request({
    url: `${ADMINAPI}/product/${data.id}`,
    method: "put",
  });
}
